package com.test.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Configuration
public class CommonInterceptor implements HandlerInterceptor {
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
		//不缓存后退地址
		response.setHeader("Pragma","no-cache");
		response.setHeader("Cache-Control","no-store");
		response.setDateHeader("Expires",-1);
		return true;
	}
}
